package flca.projbuilder.dto;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

public class TemplateDto {

	private String name;
	private String description;
	private String toDir;
	private Map<String, String> fromTos = new HashMap<String, String>();
	private File zipSource;
	
	public TemplateDto() {
	}
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Map<String, String> getFromTos() {
		return fromTos;
	}
	public void setFromTos(Map<String, String> fromTos) {
		this.fromTos = fromTos;
	}

	//-- the values below are NOT read initially via Json file, but added later in the program
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getToDir() {
		return toDir;
	}
	public void setToDir(String toDir) {
		this.toDir = toDir;
	}
	public File getZipSource() {
		return zipSource;
	}
	public void setZipSource(File zipSource) {
		this.zipSource = zipSource;
	}

	
	//--
	

	public void updateValue(String aKey, String aValue) {
		if (fromTos.get(aKey) != null) {
			fromTos.remove(aKey);
			fromTos.put(aKey, aValue);
		} else {
			System.out.println("no such key " + aKey);
		}
	}
	
}
